<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>

    // var num1 = 12, num2 = '34', sum = 0;
    // sum = num1 + num2;
    // console.log(sum);
    // console.log(typeof num1);
    // console.log(typeof num2);
    // console.log(typeof sum);   // 输出结果为字符型（string）

    /* 根据平均分来划分等级
     * 得到小明同学的各科平均成绩，如果大于等于90为优秀，小于90大于等于80为良好，小于80大于等于70为一般，小于70大于等于60为较差，小于60为很差 */
    var chinese_score = parseInt(prompt('请输入语文成绩:'));
    var math_score = parseInt(prompt('请输入数学成绩:'));
    var english_score = parseInt(prompt('请输入英语成绩:'));
    var average = parseInt((chinese_score + math_score + english_score) * 100 / 3) / 100;
    if (average >= 90) {
      document.write('优秀');
    } else if (average >= 80) {
      document.write('良好');
    } else if (average >= 70) {
      document.write('一般');
    } else if (average >= 60) {
      document.write('较差');
    } else {
      document.write('很差');
    }

  </script>
</body>

</html>